
cmake_minimum_required(VERSION 3.0)
project(RestfulServer)

add_compile_options(-fPIC -std=c++11 -fstack-protector-all -Wl, -z,relro,-z,now,-z,noexecstack -s -pie)
add_definitions(-D_GLIBCXX_USE_CXX11_ABI=0 -Dgoogle=mindxsdk_private)

set(BIN_NAME "detection_server")

set(CMAKE_CXX_STANDARD 11)

set(MX_SDK_HOME $ENV{MX_SDK_HOME})
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/")

# find_package(OpenSSL REQUIRED)
find_package(Boost REQUIRED COMPONENTS system)
# find_package(OpenCV REQUIRED)

include_directories(
    http detect
    /usr/local/include
    ${MX_SDK_HOME}/include
    ${MX_SDK_HOME}/opensource/include
    ${MX_SDK_HOME}/opensource/include/opencv4
)

link_directories(
    ${MX_SDK_HOME}/lib
    ${MX_SDK_HOME}/include
    ${MX_SDK_HOME}/opensource/lib
    /usr/local/lib
)

add_executable(${BIN_NAME} main.cpp
       	http/HttpServer.cpp
	detect/DetectionInfer.cpp
	detect/PostProcess.cpp
	detect/JsonSerialize.cpp
	)

target_link_libraries(${BIN_NAME} PRIVATE 
       	cpprest Boost::system 
	crypto ssl pthread
    	glog mxbase
	opencv_world
	)
